<extend name="./Application/Common/View/block/base.php" />
<block name="header">
    <include file="./Application/Admin/View/block/easyui_header.php" />
    <style>
        #dg{
            height: 100%;;
        }
    </style>
</block>
<block name="bdoy">
    <body>
    <table id="grid_gate_log"></table>
    <div id="grid_gate_log_ToolBar" style="padding:5px;height:auto">
        <div id="queryParamZone_gate_log">
            <form id="queryForm_Gatelog" method="post" action="">
                <table>
                    <tr>
                        <td>设备状态：</td>
                        <td>
                            <select  name="status" style="width: 80px;">
                                {:gate_status_option()}
                            </select>
                        </td>
                        <td>从：</td>
                        <td><input class="easyui-datebox" name="start" style="width: 100px;"></td>
                        <td>到：</td>
                        <td><input class="easyui-datebox" name="end" style="width: 100px;"></td>
                        <td><span><a id="btnQueryGatelog" href="#" class="easyui-linkbutton" iconCls="icon-search">查询</a></span></td>
                        <td><a href="#" class="easyui-linkbutton" iconCls="icon-undo" onclick="javascript:$('#queryForm_Gatelog').form('clear');">重置</a></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>

    </body>
</block>
<block name="footExtendJs">
    <script type="text/javascript">
        //$.noConflict();
        $(window).resize(function() {
            $('#grid_gate_log').datagrid('resize');
        });

        function cleargatelogForm(){
            $('#gatelogForm').form('clear');
        }

        function clearQueryParamZone(){
            $('#queryForm_Gatelog').form('clear');
        }

        $(function(){
            $('#grid_gate_log').datagrid({
                //title:'闸门',
                width: '100%',
                //height: 400,
                fit: true,
                nowrap: false,
                striped: true,
                collapsible:false,
                url:'/Manage/AdminCsdtGate/log_get_all',
                queryParams:{gateid:{:I('get.fy_id')},page:1,rows:20},
                method:'get',
                pageNumber:1,
                pageSize:20,
                idField:'id',
                remoteSort: false,
                columns:[[
                    {field:'id',title:'序号',width:60,checkbox:true},
                    {field:'sta_name',title:'调蓄池',width:180,align:'center'},
                    {field:'gate_name',title:'闸门',width:100,align:'center'},
                    {field:'status',title:'设备状态',width:100,align:'center'},
                    {field:'gate_start',title:'开闸时间',width:140,align:'center'},
                    {field:'gate_off',title:'关闸时间',width:140,align:'center'},
                    {field:'error_time',title:'故障时间',width:140,align:'center'},
                    {field:'work_time',title:'运行时长(小时)', width:100,align:'center'},
                    {field:'gate_reson',title:'开闸原因',width:140,align:'center'},
                    {field:'gate_height',title:'闸门开启高度',width:140,align:'center'},

                ]],
                pagination:true,
                rownumbers:true,
                singleSelect:true,
                toolbar: '#grid_gate_log_ToolBar',

                rowStyler: function(index,row){
                    if (row.status_index < 0){
                        return 'background:rgba(255, 133, 133, 1);;color:#ffffff;';
                    }
                },
                onLoadSuccess: function(data) {
                    $(this).datagrid('resize');
                }
            });

            $('#btnQueryGatelog').click(function() {
                var obj = $('#queryForm_Gatelog').serializeJson();
                obj['gateid'] = {:I('get.fy_id')};
                $('#grid_gate_log').datagrid('load',obj);
            });
        });
    </script>
</block>